<?php
/**
 * Created by Engineer CuiLiwu.
 * Project: deal.
 * Date: 2018/6/20-13:46
 * License Hangzhou orce Technology Co., Ltd. Copyright © 2018
 */

namespace App\Http\Controllers\Backend\Im;

use App\ConstDir\ErrorConst;
use App\Http\Controllers\Backend\BaseController;
use App\Repository\Repositories\Interfaces\UserImRepository;
use Illuminate\Http\Request;
use Prettus\Repository\Criteria\RequestCriteria;

class ImController  extends BaseController
{
    /**
     * @var UserImRepository
     */
    protected $userIm_repo;
    protected $request;

    public function __construct(UserImRepository $userIm_repo, Request $request)
    {
        parent::__construct();
        $this->userIm_repo = $userIm_repo;
        $this->request = $request;
    }

    /**
     *  IM 用户列表
     * */
    public function index(){
        $list = $this->userIm_repo->paginate($this->perPage);

        return $this->success(ErrorConst::SUCCESS_CODE, $list, true);
    }

    /**
     *  删除
     * */
    public function delete($id){
        $list = $this->userIm_repo->delete($id);

        return $this->success(ErrorConst::SUCCESS_CODE, $list);
    }

}